# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php82-pecl-apfd
_extname=apfd
pkgver=1.0.3
pkgrel=0
pkgdesc="PHP 8.2 extension for always populate form data - PECL"
url="https://pecl.php.net/package/apfd"
arch="all"
license="BSD-2-Clause"
_phpv=82
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev"
checkdepends="$_php-cgi"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir/$_extname-$pkgver"

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=php-config$_phpv
	make
}

check() {
	$_php -d extension="$builddir"/modules/$_extname.so --ri $_extname
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test TESTS=--show-diff
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	mkdir -p $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
1290594de5d2992cb2d46308ee5c3f44d30dc478afc60ce38f1bc3215c56fa3f396e6a8a90ed9288d4c5c61e8f8bdf77c682bfa0d83494647c61e0920048ea59  php-pecl-apfd-1.0.3.tgz
"
